/*
 * TODO
 */
package com.xtrip.adm.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xtrip.adm.dao.CBDDao;
import com.xtrip.adm.model.CBD;
import com.xtrip.adm.model.City;
import com.xtrip.base.BaseDao;
import com.xtrip.base.BaseService;
import com.xtrip.common.BasicConstant;
import com.xtrip.util.IdGenerator;

/**
 * @project xtrip
 * @author shiming.yao
 * @time 2013-5-23
 */
@Service("cbdService")
public class CBDService extends BaseService<CBD>{

	@Resource(name="cbdDao")
	private CBDDao dao;
	//UPDATE tmp_hotel t SET t.cid=(SELECT t1.id FROM tmp_city t1 WHERE t1.tc_cid=t.cid)
	/* (non-Javadoc)
	 * @see com.xtrip.base.BaseService#getDao()
	 */
	@Override
	public BaseDao<CBD> getDao() {
		// TODO Auto-generated method stub
		return dao;
	}
	public boolean insertCbd(CBD cbd){
		String id = IdGenerator.generateId(BasicConstant.PREFIX_CBD);
		cbd.setId(id);
		return dao.insert(cbd)==1;
	}
	public void updateCbd(CBD cbd){
		dao.update(cbd);
	}
}
